package day04.homework;

import java.util.Scanner;

public class textDemo03 {
    public static void main(String[] args) {
//        Scanner scan = new Scanner(System.in);
//
//        int num = (int)(Math.random()*1000+1);
//        System.out.println(num);
//        int guee ;
//
//        do {
//            System.out.println("猜吧");
//            guee = scan.nextInt();
//            if (guee>num){
//                System.out.println("猜大了");
//            }else if (guee<num){
//                System.out.println("猜小了");
//            }else {
//                System.out.println("猜对了！");
//            }
//        }while (guee!=num);

        Scanner scan = new Scanner(System.in);
        int abc = (int)(Math.random()*1000+1);

        System.out.println(abc);
        int num;
        do {
            System.out.println("请猜吧");
            num = scan.nextInt();
            if (num >abc){
                System.out.println("猜大了");
            }else if(num<abc){
                System.out.println("猜小了");
            }else{
                System.out.println("猜对了");
            }
        }while (num !=abc);
    }
}
